function [w, phiCoord] = m_step(S, e, Coords, phiCoord)
global g_N;

w = sum(e).'/g_N;
for s = 1:S
    e_s = e(:, s);
    phiCoord(s, :) = sum(cat(2, e_s, e_s).*Coords)/sum(e_s);
end

end